const mongoose = require("mongoose");
const baseModel = require("./base-model");
const Schema = mongoose.Schema;
const articleSchema = new mongoose.Schema({
  title: {
    type: String,
    required: true,
  },
  body: {
    type: String,
    required: true,
  },
  authorName: {
    type: String,
    required: true,
  },
  type: {
    type: Number,
    required: true,
  },
  author: {
    type: Schema.Types.ObjectId,
    ref: "User",
    required: true,
  },
  creatAt: {
    type: Date,
    default: Date.now,
  },
  ...baseModel,
});

//组织导出模型
module.exports = articleSchema;
